
<%@ page import="br.com.zanictech.ponto.*" %>
<%
	def logado = AuthController.logado
 %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'registroPonto.label', default: 'RegistroPonto')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'registroPonto.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="data" title="${message(code: 'registroPonto.data.label', default: 'Data')}" />
                        
                            <g:sortableColumn property="entrada" title="${message(code: 'registroPonto.entrada.label', default: 'Entrada')}" />
                        
                            <g:sortableColumn property="almoco" title="${message(code: 'registroPonto.almoco.label', default: 'Almoco')}" />
                        
                            <g:sortableColumn property="tarde" title="${message(code: 'registroPonto.tarde.label', default: 'Tarde')}" />
                        
                            <g:sortableColumn property="saida" title="${message(code: 'registroPonto.saida.label', default: 'Saida')}" />
                            
                            <th>Observações</th>
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${registroPontoInstanceList}" status="i" var="registroPontoInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${registroPontoInstance.id}">${fieldValue(bean: registroPontoInstance, field: "id")}</g:link></td>
                        
                            <td><g:formatDate date="${registroPontoInstance.data}" formatName="registroPonto.data.horario" /></td>
                        
                            <td>${fieldValue(bean: registroPontoInstance, field: "entrada")}</td>
                        
                            <td>${fieldValue(bean: registroPontoInstance, field: "almoco")}</td>
                        
                            <td>${fieldValue(bean: registroPontoInstance, field: "tarde")}</td>
                        
                            <td>${fieldValue(bean: registroPontoInstance, field: "saida")}</td>
                            
                            <td>${fieldValue(bean: registroPontoInstance, field: "observacao")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <%--
            <div class="paginateButtons">
                <g:paginate total="${registroPontoInstanceTotal}" />
            </div>
            --%>
            <div class="relatorio">
            	<g:jasperReport jasper="horario" format="PDF" name="Relatório do Horário">
            		<input type="hidden" name="usuario_id" value="${ logado }"/>
            		<label>| Período de: </label>
            		<input type="date" name="dataDe"/>
            		<label>até </label>
            		<input type="date" name="dataAte" />
            		<!-- pattern="((?:30))|(?:(?:0[13578]|1[02])-31)/?:(?:0[1-9]|1[0-2])/(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2]))/(?:19|20)[0-9]{2}" -->
            	</g:jasperReport>
            </div>
        </div>
    </body>
</html>
